package mystruts;

import com.opensymphony.xwork2.ActionSupport;

public class TestAction extends ActionSupport{

	public String execute() throws Exception {
		this.LOG.debug("Hello1");
		this.LOG.info("Hello2");
        System.out.println("TestAction.execute....");
        System.out.println("username:" + this.getUsername());
        System.out.println("password:" + this.getPassword());
        String nexaPage="";
        if( this.getUsername()==null && this.getPassword()==null){
        	
        
        	this.setMes("welcome");
        	nexaPage="testLogin";
        }else if( "tom".equals(this.getUsername()) && "1234".equals(this.getPassword())){
        	this.setMes("loign sucess..");
        	nexaPage=SUCCESS;
        }else{
        	this.setMes("pls check id ,paswd ..");
        	nexaPage="testLogin";
        }
        return nexaPage;
    }
	String mes;
	String username;
	String password;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getMes() {
		return mes;
	}
	public void setMes(String mes) {
		this.mes = mes;
	}
	
}
